'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);

  // 登录接口
  router.post('/api/login', controller.login.login);

  // 获取用户信息
  router.get('/api/getuserinfo', controller.login.user)

  // 获取身份列表
  router.get('/api/getIdentityList', controller.home.getIdentityList)

  // 添加身份
  router.post('/api/addIdentityList', controller.home.addIdentityList)

  // 添加用户
  router.post('/api/addUserList', controller.home.addUserList)

  // 更改身份视图权限
  router.post('/api/editIdentityAuth', controller.home.editIdentityAuth)
  
  // 获取考试类型
  router.get('/api/getExamType', controller.home.getExamType)

  // 获取课程类型
  router.get('/api/classType', controller.home.getCalssType)

  // 添加试题
  router.post('/api/addExamList', controller.home.addExamList)

  // 获取考试列表
  router.post('/api/getExamList', controller.home.getExamList)

};
